<%--
  Created by IntelliJ IDEA.
  User: cyy
  Date: 2022/11/28
  Time: 13:47
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.cyy.bean.history" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="com.cyy.bean.history" %>
<%@ taglib prefix="rapid" uri="http://www.rapid-framework.org.cn/rapid" %>
<!DOCTYPE html>
<html>
<head>
    <title>用户购买日志浏览</title>
    <link rel="stylesheet" href="css/bg.css" type="text/css" media="all">
</head>
<body>
    <rapid:override name="menuName">
        <%=session.getAttribute("name")%>
    </rapid:override>
    <rapid:override name="mainContent">
        <div class="cart-page" align="center">
            <div class="container-fluid">
                <div class="row" >
                    <div class="col-md-2"></div>
                    <div class="col-md-8">
                        <div class="cart-page-inner">
                            <div class="table-responsive">
                                <table class="table table-bordered" id="tableSort">
                                    <thead class="thead-dark">
                                    <tr>
                                    <tr>
                                        <th id="th0" onclick="tablesort('tableSort',0)">用户名<i class="iconfont icon-shangxiajiantou"></i></th>
                                        <th id="th1" onclick="tablesort('tableSort',1)">商品名<i class="iconfont icon-shangxiajiantou"></i></th>
                                        <th id="th2" onclick="tablesort('tableSort',2)">数目<i class="iconfont icon-shangxiajiantou"></i></th>
                                        <th id="th3" onclick="tablesort('tableSort',3)">总价<i class="iconfont icon-shangxiajiantou"></i></th>
                                        <th id="th4" onclick="tablesort('tableSort',4)">时间<i class="iconfont icon-shangxiajiantou"></i></th>
                                        <th id="th5" onclick="tablesort('tableSort',5)">状态<i class="iconfont icon-shangxiajiantou"></i></th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <%
                                        ArrayList<history> historys=(ArrayList<history>)session.getAttribute("historys");
                                        if(historys!=null)
                                        {
                                            for (int i=0;i<historys.size();i++) {%>
                                    <tr>
                                        <td><%=historys.get(i).getUserName()%></td>
                                        <td><%=historys.get(i).getProductName()%></td>
                                        <td><%=historys.get(i).getNum()%></td>
                                        <td><%=historys.get(i).getPrice()*historys.get(i).getNum()%></td>
                                        <td><%=historys.get(i).getTime()%></td>
                                        <%if(historys.get(i).getState()==0)
                                        {%>
                                        <td>待发货</td>
                                        <%}else{%>
                                        <td>已确认发货</td>
                                        <%}%>
                                    </tr>
                                    <%}}%>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-2"></div>
                </div>
            </div>
        </div>
    </rapid:override>
    <%@ include file="salesmanMenuBarIndex.jsp"%>
</body>
</html>
